load("@rules_python//python:defs.bzl", "py_library")
load("@tink_py_pip_deps//:requirements.bzl", "requirement")

package(default_visibility = ["//:__subpackages__"])

py_library(
    name = "core",
    srcs = ["__init__.py"],
    srcs_version = "PY3",
    visibility = ["//visibility:public"],
    deps = [
        ":_crypto_format",
        ":_key_manager",
        ":_primitive_set",
        ":_primitive_wrapper",
        ":_registry",
        ":_tink_error",
        "//tink/proto:tink_py_pb2",
    ],
)

py_library(
    name = "_key_manager",
    srcs = ["_key_manager.py"],
    srcs_version = "PY3",
    deps = [
        ":_tink_error",
        "//tink/proto:tink_py_pb2",
    ],
)

py_library(
    name = "_tink_error",
    srcs = ["_tink_error.py"],
    srcs_version = "PY3",
    deps = [
        "//tink/cc/pybind:tink_bindings",
    ],
)

py_library(
    name = "_registry",
    srcs = ["_registry.py"],
    srcs_version = "PY3",
    deps = [
        ":_key_manager",
        ":_primitive_set",
        ":_primitive_wrapper",
        ":_tink_error",
        "//tink/proto:tink_py_pb2",
    ],
)

py_test(
    name = "_registry_test",
    srcs = ["_registry_test.py"],
    srcs_version = "PY3",
    deps = [
        ":core",
        requirement("absl-py"),
        "//tink/aead",
        "//tink/hybrid",
        "//tink/mac",
        "//tink/mac:_mac_wrapper",
        "//tink/prf",
        "//tink/prf:_prf_set_wrapper",
        "//tink/proto:tink_py_pb2",
        "//tink/testing:helper",
    ],
)

py_library(
    name = "_crypto_format",
    srcs = ["_crypto_format.py"],
    srcs_version = "PY3",
    deps = [
        ":_tink_error",
        "//tink/proto:tink_py_pb2",
    ],
)

py_test(
    name = "_crypto_format_test",
    srcs = ["_crypto_format_test.py"],
    srcs_version = "PY3",
    deps = [
        ":core",
        requirement("absl-py"),
        "//tink/proto:tink_py_pb2",
    ],
)

py_library(
    name = "_primitive_set",
    srcs = ["_primitive_set.py"],
    srcs_version = "PY3",
    deps = [
        ":_crypto_format",
        ":_tink_error",
        "//tink/proto:tink_py_pb2",
    ],
)

py_test(
    name = "_primitive_set_test",
    srcs = ["_primitive_set_test.py"],
    srcs_version = "PY3",
    deps = [
        ":core",
        requirement("absl-py"),
        "//tink/aead",
        "//tink/mac",
        "//tink/proto:tink_py_pb2",
        "//tink/testing:helper",
    ],
)

py_library(
    name = "_primitive_wrapper",
    srcs = ["_primitive_wrapper.py"],
    srcs_version = "PY3",
    deps = [
        ":_primitive_set",
    ],
)
